﻿using Microsoft.Phone.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MapHello
{
    public static class Controller
    {
        public static void Navigate(PhoneApplicationPage page, Uri uri, bool clearStack = false)
        {
            while (page.NavigationService.BackStack.Any() && clearStack)
            {
                page.NavigationService.RemoveBackEntry();
            }

            page.NavigationService.Navigate(uri);
        }
    }
}
